#include <iostream>

using namespace std;

void hannuo(int c, char q, char z, char h);
void move(char q, char h);

int main(void)
{
	hannuo(10, 'A', 'B', 'C');

	return 0;
}

void hannuo(int c, char q, char z, char h)
{
	if(c == 0)
		return;
	else
	{
		hannuo(c - 1, q, h, z);
		move(q, h);
		hannuo(c - 1, z, q, h);
	}
}

void move(char q, char h)
{
	cout << q << "-->" << h << endl;
}
